package edu.gatech.cs2340.bytebankers.view;

import javax.swing.JPanel;

import edu.gatech.cs2340.bytebankers.presenter.IStorePresenter;

public class TestStoreView implements IStoreView{

	int inventoryLength;
	double money;
	int[] quant;
	int maxQuant = 5;
	int curQuant = 0;
	IStorePresenter presenter;
	double availableWeight;
	
	public TestStoreView(IStorePresenter presenter) {
		this.presenter = presenter;
	}
	
	@Override
	public void setInventory(double[] price, String[] itemName,
		int[] inventQuant, double[] weight) {
		inventoryLength = inventQuant.length;
		quant = new int[inventoryLength];
		for(int i = 0; i < inventoryLength; i++) {
			quant[i] = curQuant;
			curQuant++;
			if(curQuant > maxQuant) {
				curQuant = 0;
			}
		}
		CheckoutClicked();
	}

	@Override
	public void setBankroll(double currentMoney) {
		money = currentMoney;
	}

	@Override
	public void setName(String name) {

	}

	@Override
	public void CheckoutClicked() {
		presenter.checkoutClicked();
	}

	@Override
	public int[] getQuant() {
		return quant;
	}

	@Override
	public void setAvailableWeight(double weight) {
		availableWeight = weight;
	}

	@Override
	public JPanel getMainPanel() {
		return null;
	}



}
